package com.smartwebx.ha.web.admin.module.screen.report;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.dataresolver.Param;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.smartwebx.ha.biz.assign.HaDirectoryManager;
import com.smartwebx.ha.biz.assign.HaReportManager;
/**
 * 
 * 创建人：Dream~天涯 
 * 创建时间：2015-4-21 上午11:30:07
 * 邮箱：154494796@qq.com
 * 备注：
 */
public class AjaxReportId {
	@Autowired
	private HttpServletResponse response;
	@Autowired
	private HaReportManager haReportManager;
	@Autowired
	private HaDirectoryManager haDirectoryManager;
	public void execute(@Param("id") String haDriectoryId) throws Exception{
		response.setContentType("application/json");
		PrintWriter out=response.getWriter();
		ObjectMapper mapper=new ObjectMapper();
		Integer reportId = haDirectoryManager.getReportId(haDriectoryId);
		mapper.writeValue(out, reportId);
	}
}
